<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>中心领导的查看页面</title>
    <link rel="stylesheet" href="../../res/layui/css/layui.css" media="all">
    <!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
    <script src="../../res/js/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../res/layui/layui.js"></script>
    <script src="../../res/js/Tools.js"></script>
</head>
<body>
<form class="layui-form" action="" id="Leader">
    <input type="hidden" name="leaderId" id="leaderId"/>
    <div class="layui-form-item"></div>
    <div class="layui-form-item">
        <label class="layui-form-label">领导名称</label>
        <div class="layui-input-inline">
            <input disabled="disabled" class="layui-input" type="text" name="leaderName" id="leaderName" required
                   lay-verify="required" placeholder="领导名称" autocomplete="off"/>
        </div>
        <label class="layui-form-label">部门名称</label>
        <div class="layui-input-inline">
            <input disabled="disabled" class="layui-input" type="text" name="deptName" id="deptName" required
                   lay-verify="required" placeholder="部门名称" autocomplete="off"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">岗位名称</label>
        <div class="layui-input-inline">
            <input disabled="disabled" class="layui-input" type="text" name="postName" id="postName" required
                   lay-verify="required" placeholder="岗位名称" autocomplete="off"/>
        </div>
        <label class="layui-form-label">负责事务</label>
        <div class="layui-input-inline">
            <input disabled="disabled" class="layui-input" type="text" name="leaderBusiness" id="leaderBusiness" required
                   lay-verify="required" placeholder="负责事务" autocomplete="off"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">职责说明</label>
        <div class="layui-input-inline">
            <input disabled="disabled" class="layui-input" type="text" name="leaderExp" id="leaderExp" required
                   lay-verify="required" placeholder="职责说明" autocomplete="off"/>
        </div>
        <label class="layui-form-label">联系方式</label>
        <div class="layui-input-inline">
            <input disabled="disabled" class="layui-input" type="text" name="phone" id="phone" required
                   lay-verify="required" placeholder="职责说明" autocomplete="off"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">通讯地址</label>
        <div class="layui-input-inline">
            <input disabled="disabled" class="layui-input" type="text" name="addr" id="addr" required
                   lay-verify="required" placeholder="职责说明" autocomplete="off"/>
        </div>
        <label class="layui-form-label">其他说明</label>
        <div class="layui-input-inline">
            <input disabled="disabled" class="layui-input" type="text" name="other" id="other" required
                   lay-verify="required" placeholder="其他说明" autocomplete="off"/>
        </div>
    </div>
</form>
<script>
    layui.use(['form', 'layedit', 'laydate'], function() {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;
        //日期渲染
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });
        /**
         * 新增和修改
         */
        var form = null ;
        layui.use('form', function(){
            form = layui.form;

            var id = getQueryString("id");
            if(id !="" && id != null){
                findlx(id);
            }
        });
        /**
         * 修改显示
         */
        function findlx(){
            var id = getQueryString("id");
            //var username = document.getElementById("isva").value;
            //alert(username);
            if(id){
                var url = "../../UserseControllerLeader/select";
                var data = {leaderId:id};
                //jquery的ajax方法,查询类型的方法
                $.get(url,data,function(obj){
                    //从后台传过来的数据obj$("[value='11']").prop("checked",true);
                    $("#leaderId").val(obj.leaderId);
                    $("#leaderName").val(obj.leaderName);
                    $("#deptName").val(obj.deptName);
                    $("#postName").val(obj.postName);
                    $("#leaderBusiness").val(obj.leaderBusiness);
                    $("#leaderExp").val(obj.leaderExp);
                    $("#phone").val(obj.phone);
                    $("#addr").val(obj.addr);
                    $("#other").val(obj.other);
                    //重新渲染
                    form.render();
                },"json");
            }

        }
    });

</script>
</body>
</html>